package com.lvcoding.auth2.auth.shizhan.verifycode.sms;

import cn.hutool.core.util.RandomUtil;
import com.lvcoding.auth2.auth.shizhan.verifycode.parent.VerifyCodeGenerator;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.ServletWebRequest;


/**
 * @author wuyanshen
 */
@Component
public class SmsVerifyCodeGenerator implements VerifyCodeGenerator {
    @Override
    public SmsCode generate(ServletWebRequest servletWebRequest) throws Exception {
        String code = RandomUtil.randomString("1234567890", 4);
        return new SmsCode(code, 1);
    }
}
